package com.alit.face.koala.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.alit.face.koala.entity.KoalaHistoryCallback;
import com.alit.face.koala.service.HistoryKoalaCallbackService;

/**
 * @author litong
 * @date 2019年5月10日_下午8:28:41
 * @version 1.0
 */
@RestController
@RequestMapping("HistoryKoalaCallback")
public class HistoryKoalaCallbackController {

  @Autowired
  private HistoryKoalaCallbackService hkcs;

  @RequestMapping("list")
  public String list(int page, int rows) {
    JSONObject jsonObject = new JSONObject();
    Page<KoalaHistoryCallback> doaminPage = hkcs.paginate(page, rows);
    jsonObject.put("total", doaminPage.getTotalElements());
    jsonObject.put("rows", doaminPage.getContent());
    return jsonObject.toJSONString();
  }
}
